fix(cli): read AGENT_BROWSER_CDP from environment variable#394
Open
anthrotype wants to merge 1 commit intovercel-labs:mainfrom
Open
fix(cli): read AGENT_BROWSER_CDP from environment variable#394anthrotype wants to merge 1 commit intovercel-labs:mainfrom
anthrotype wants to merge 1 commit intovercel-labs:mainfrom
Conversation
The --cdp flag allows connecting to an existing browser via CDP, but unlike every other flag (AGENT_BROWSER_EXECUTABLE_PATH, AGENT_BROWSER_PROFILE, AGENT_BROWSER_PROXY, etc.), it had no environment variable fallback. This means users who always connect via CDP had to pass --cdp on every invocation instead of setting it once via AGENT_BROWSER_CDP. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
@anthrotype is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
--cdpflag allows connecting to an existing browser via CDP, but unlike every other CLI flag (AGENT_BROWSER_EXECUTABLE_PATH,AGENT_BROWSER_PROFILE,AGENT_BROWSER_PROXY,AGENT_BROWSER_ARGS, etc.), it had no environment variable fallback. The default was hardcoded toNone.This one-line fix reads
AGENT_BROWSER_CDPfrom the environment, following the exact same pattern as all sibling flags inflags.rs.Use case
Users who always connect to an existing browser via CDP (e.g., a remote Chrome instance over SSH tunnel) had to pass
--cdp <port>on every single invocation. With this fix, they can setAGENT_BROWSER_CDP=9223once in their shell profile and all commands just work.Before
# Every command needs --cdp agent-browser --cdp 9223 open https://example.com agent-browser --cdp 9223 snapshot -i agent-browser --cdp 9223 tab listAfter
export AGENT_BROWSER_CDP=9223 agent-browser open https://example.com agent-browser snapshot -i agent-browser tab listChanges
cli/src/flags.rs:cdp: None→cdp: env::var("AGENT_BROWSER_CDP").ok()